//
//  HYRefresh.m
//  HaiYue
//
//  Created by skyline on 2018/7/4.
//  Copyright © 2018年 skyline. All rights reserved.
//

#import "HYRefresh.h"

@interface HYRefreshHeader()
@property (nonatomic, strong) UIImageView *logoView;


@end
@implementation HYRefreshHeader
- (void)prepare{
    [super prepare];
    // 初始化间距
    self.labelLeftInset = MJRefreshLabelLeftInset;
    
    // 初始化文字
    //    self.logoView = [[UIImageView alloc] init];
    //    self.logoView.image = [UIImage imageNamed:@"tjssc"];
    //    [self addSubview:self.logoView];
    self.automaticallyChangeAlpha = YES;
    //    self.lastUpdatedTimeLabel.hidden = YES;//隐藏时间
    [self setTitle:@"松开开始刷新..." forState:MJRefreshStatePulling];
    [self setTitle:@"刷新中..." forState:MJRefreshStateRefreshing];
    [self setTitle:@"已刷新..." forState:MJRefreshStateNoMoreData];
}
- (void)placeSubviews
{
    [super placeSubviews];
    
    self.logoView.mj_x = 0;
    self.logoView.mj_w = self.mj_w;
    self.logoView.mj_h = 100;
    self.logoView.mj_y =  -self.logoView.mj_h;
}


/*
 // Only override drawRect: if you perform custom drawing.
 // An empty implementation adversely affects performance during animation.
 - (void)drawRect:(CGRect)rect {
 // Drawing code
 }
 */

@end


@interface HYRefreshFooder()
@property (nonatomic, strong) UIImageView *logoView;

@end
@implementation HYRefreshFooder
- (void)prepare{
    [super prepare];
    
    //    MJRefreshStateIdle ,         /** 普通闲置状态 */
    //    MJRefreshStatePulling,       /** 松开就可以进行刷新的状态 */
    //    MJRefreshStateRefreshing,    /** 正在刷新中的状态 */
    //    MJRefreshStateWillRefresh,   /** 即将刷新的状态 */
    //    MJRefreshStateNoMoreData     /** 所有数据加载完毕，没有更多的数据了 */
    // 初始化间距
    self.labelLeftInset = MJRefreshLabelLeftInset;
    
    self.stateLabel.textColor = [UIColor grayColor];
    [self setTitle:@"向上拉加载更多内容喔..." forState:MJRefreshStateIdle];
    [self setTitle:@"加载中..." forState:MJRefreshStateRefreshing];
    [self setTitle:@"加载完毕!没有更多数据了！" forState:MJRefreshStateNoMoreData];
    
    self.logoView = [[UIImageView alloc] init];
    //    self.logoView.image = [UIImage imageNamed:@"tjssc"];
    [self addSubview:self.logoView];
    
}
- (void)placeSubviews
{
    [super placeSubviews];
    
    self.logoView.mj_x = 0;
    self.logoView.mj_w = self.mj_w;
    self.logoView.mj_h = 100;
    self.logoView.mj_y =  -self.logoView.mj_h;
}
@end
